#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		int x;
		cin >> x;
		if (x < 18) {
			cout << x << endl;
		}
		else {
			cout << 18 << endl;
		}
	}
	return 0;
}